package gewu.suleju.controller;

import gewu.suleju.model.vo.PageInfoAll;
import gewu.suleju.model.vo.Result;
import gewu.suleju.sevice.ISearchHouseInforAllService;
import gewu.suleju.sevice.ISearchLatitudeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Set;

@Controller
@RequestMapping("searchLatitude")
public class SearchLatitudeController {
    @Autowired
    private ISearchLatitudeService iSearchLatitudeService;

    @Autowired
    private RedisTemplate redisTemplate;

    @ResponseBody//将java对象转化成json对象
    @PostMapping("search")
    public Result searchLatitude(Integer id) {
        //清空redis
        Set<String> keys = redisTemplate.keys("*");
        redisTemplate.delete(keys);

        List<String> list = (List<String>) redisTemplate.opsForValue().get("Latitude");

        return new Result("200","经纬度",list);
    }
}
